package cn.wsalix.weixin.req.entity;

import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import cn.wsalix.weixin.util.XStreamCDataConverter;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamConverter;

@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "WX_REQ_EVENT_QR")
@Inheritance(strategy = InheritanceType.JOINED)
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@EntityListeners({ AuditingEntityListener.class })
public final class QrCodeEvent extends BaseEvent {

    /**
	 * 
	 */
	private static final long serialVersionUID = -5254096646049477545L;
	@XStreamAlias("EventKey")
	@XStreamConverter(value = XStreamCDataConverter.class)
	private String eventKey;
    private String ticket;

    public QrCodeEvent(String eventKey, String ticket) {
        super();
        this.eventKey = eventKey;
        this.ticket = ticket;
    }

    public String getEventKey() {
        return eventKey;
    }

    public String getTicket() {
        return ticket;
    }

}
